<!--Copyright (C) Kherty.  All rights reserved.-->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    x:Class="OpenLS.UI.XPOfficeWindowResources"
                    xmlns:oui="clr-namespace:OpenLS.UI"
    >
  <LinearGradientBrush x:Key="titleBrush" StartPoint ="0,0" EndPoint="0,1">
      <GradientStop Offset ="0" Color="#e1ebf8"/>
      <GradientStop Offset ="0.2" Color="#d9e7f9"/>
      <GradientStop Offset ="0.2" Color="#cde0f8"/>
      <GradientStop Offset ="0.5" Color="#d7e6fa"/>
      <GradientStop Offset ="0.7" Color="#dbe9fb"/>
      <GradientStop Offset ="1" Color="#e4effd"/>
  </LinearGradientBrush>
  <SolidColorBrush x:Key="titleBrush2" Color="#e4effd"/>

  <Style x:Key="windowButton" TargetType="{x:Type Button}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Width" Value="24"/>
    <Setter Property="Height" Value="24"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Button}">
          <Border BorderThickness="1" BorderBrush="Transparent" Background="Transparent" x:Name="bd" CornerRadius="1">
            <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="BorderBrush" Value="LightBlue" TargetName="bd"/>
              <Setter Property="Background" TargetName="bd">
                <Setter.Value>
                  <RadialGradientBrush Center="0.5 0.3" RadiusX="0.5" RadiusY="0.7">
                    <GradientStop Color ="White" Offset="0"/>
                    <GradientStop Color ="Transparent" Offset="1"/>
                  </RadialGradientBrush>
                </Setter.Value>
              </Setter>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>


  <ControlTemplate TargetType="{x:Type  Window}" x:Key="XPOfficeWindowTemplate">
        <AdornerDecorator>
            <Grid>
                <Border BorderThickness="1" BorderBrush="Black" CornerRadius="4">
                    <Grid Background="{x:Static Brushes.White}" Name="PART_MainGrid">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="30"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.Resources>
                                <SolidColorBrush Color="#FFF8F9FA" x:Key="Light"/>
                                <SolidColorBrush Color="#FF656565" x:Key="Dark"/>
                                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0" x:Key="Medium">
                                    <GradientStop Offset="0" Color="#FF798DA7" />
                                    <GradientStop Offset="1" Color="#FF8BA7CC" />
                                </LinearGradientBrush>
                            </Grid.Resources>
                            <DockPanel Grid.ColumnSpan ="2" DockPanel.Dock ="Top"  LastChildFill="True" Height="30" Background="{StaticResource titleBrush}"
                   MouseDown ="OnRectangleMouseDown" SnapsToDevicePixels="True" Name="maindp">
                                <Button ToolTip ='Close' Click='OnClose'  DockPanel.Dock="Right" Style="{StaticResource windowButton}" >
                                    <Grid>
                                        <Path StrokeThickness="2" Stroke='{StaticResource Medium}' Data='M0.5,0.5 L8.5,8.5 M8.5,0.5 L0.5,8.5'/>
                                        <Path StrokeThickness='1' Stroke='{StaticResource Dark}' Data='M0.5,0.5 L2.5,0.5 M3.5,1.5 L3.5,1.5 M 4.5,2.5 L4.5,2.5 M 5.5,1.5 L 5.5,1.5 M6.5,0.5 L6.5,0.5 M 6.5,0.5 L 8.5,0.5' StrokeEndLineCap='Square' StrokeStartLineCap='Square'/>
                                        <Path StrokeThickness='1' Stroke='{StaticResource Light}' Data='M0.5,8.5 L2.5,8.5 M3.5,7.5 L3.5,7.5 M 4.5,6.5 L4.5,6.5 M 5.5,7.5 L 5.5,7.5 M6.5,8.5 L6.5,8.5 M 6.5,8.5 L 8.5,8.5' StrokeEndLineCap='Square' StrokeStartLineCap='Square'/>
                                    </Grid>
                                </Button>
                                <Button ToolTip ='Restore' Click='OnRestore'  DockPanel.Dock="Right"  Style="{StaticResource windowButton}"  >
                                    <Grid>
                                        <Path StrokeThickness="1" Stroke='{StaticResource Dark}' Data='M0.5,0.5 L 0.5,0.5 L8.5,0.5'/>
                                        <Path StrokeThickness="1" Stroke='{StaticResource Light}' Data='M0.5,3.5 L8.5,3.5 M0.5,8.5 L8.5,8.5 '/>
                                        <Path StrokeThickness="1" Stroke='{StaticResource Medium}' Data='M0.5,1.5 L8.5,1.5 L8.5,7.5 L0.5,7.5 L0.5,1.5 L8.5,1.5 M0.5,2.5 L8.5,2.5' />
                                    </Grid>
                                </Button>
                                <Button ToolTip ='Minimize' Click='OnMinimize'  DockPanel.Dock="Right"  Style="{StaticResource windowButton}">
                                    <Grid>
                                        <Path StrokeThickness="1" Stroke='{StaticResource Dark}' Data='M0,0.5 M0,7.5 L8,7.5'/>
                                        <Path StrokeThickness="1" Stroke='{StaticResource Medium}' Data='M0,0.5 M0,8.5 L8,8.5'/>
                                        <Path StrokeThickness="1" Stroke='{StaticResource Light}' Data='M0,0.5 M0,9.5 L8,9.5'/>
                                    </Grid>
                                </Button>
                                <Label Background='Transparent'
               TextBlock.TextAlignment='Center'
               MouseDoubleClick='OnToggleWindowState'
               HorizontalAlignment='Stretch'
               VerticalContentAlignment='Center'
               HorizontalContentAlignment='Center' Content='{TemplateBinding Title}' Name='titleBar'/>
                            </DockPanel>
                            <ContentPresenter  Content="{TemplateBinding oui:RibbonWindow.Ribbon}" Grid.ColumnSpan ="2" Grid.Row="1" Grid.RowSpan="1"/>
                            <AdornerDecorator Grid.ColumnSpan ="2" Grid.Row="2" Grid.RowSpan="1">
                                <ContentPresenter ContentSource="Content" />
                            </AdornerDecorator>
                            <Rectangle Grid.ColumnSpan ="2" Grid.Row="1" Margin='0 1 0 0' VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="1" Fill="{StaticResource titleBrush2}"/>
                        </Grid>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="34"/>
                                <RowDefinition Height="18"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <!--<ContentPresenter Grid.RowSpan='2' Content="{TemplateBinding ui:OfficeWindow.ApplicationMenu}" VerticalAlignment="Center"  HorizontalAlignment="Left"/> -->
                            <!--<ContentPresenter Grid.Row="0" VerticalAlignment="Center" 
                          HorizontalAlignment="Left" Grid.RowSpan="2" ContentSource="ApplicationMenu"/> -->
                            <ContentPresenter Grid.Row="1" VerticalAlignment="Center" 
                          HorizontalAlignment="Left" Grid.RowSpan="2" Content="{TemplateBinding oui:RibbonWindow.ApplicationMenu}"/>
                            <ContentPresenter Grid.Column="1" Content="{TemplateBinding oui:RibbonWindow.QuickAccessToolbar}" VerticalAlignment="Center"  HorizontalAlignment="Left"/>
                            <Grid Width="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight}" HorizontalAlignment="Left">
                                <Image Height="16" Width="16" HorizontalAlignment="Center" VerticalAlignment="Center" Source="{TemplateBinding Icon}"></Image>
                            </Grid>

                        </Grid>
                    </Grid>
                </Border>
            </Grid>
        </AdornerDecorator>
    <!--</Border> -->
  </ControlTemplate>


</ResourceDictionary>